package com.tanhua.app.controller;

import com.aliyuncs.exceptions.ClientException;
import com.tanhua.app.service.MovementsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping(value = "/movements")
public class MovementsController {

    @Autowired
    private MovementsService movementsService;


    @GetMapping(value = "/visitors", name = "最近访问人")
    public ResponseEntity visitors() throws ClientException, IOException {
        return movementsService.findHistory();
    }
}
